package luj.tool.jnproxyan.proxy.network.https.client;

import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.HttpObject;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

final class HttpsCliImpl implements HttpsCliMaker.Cli {

  @Override
  public void send(HttpObject obj) {
    _channel.writeAndFlush(obj);
  }

  @Override
  public OutputStream receiveBytesFrom() {
    return _receiveFrom;
  }

  @Override
  public void close() throws IOException {
    _receiveFrom.close();
//    _sendTo.close();

    _channel.close();
  }

  EmbeddedChannel _channel;

  OutputStream _receiveFrom;
  InputStream _sendTo;
}
